﻿<UserControl x:Class="LunarPhase.Gadget.View.LunarWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:viewmodel="clr-namespace:LunarPhase.Gadget.ViewModel"
    xmlns:conv="clr-namespace:LunarPhase.Gadget.Converter"
    mc:Ignorable="d" d:DesignHeight="110" d:DesignWidth="85">
    <UserControl.Resources>
        <viewmodel:LunarWindowViewModel x:Key="ViewModel" />
        <conv:UriToImageConverter x:Key="converter"/>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Height="110" Width="85">
        <Border BorderThickness="1" CornerRadius="15" BorderBrush="#FFD8CDCD">
            <Border.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Black" Offset="0.576" />
                    <GradientStop Color="#FF9D9393" Offset="1" />
                </LinearGradientBrush>
            </Border.Background>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" MinHeight="50"></RowDefinition>
                    <RowDefinition Height="Auto" MinHeight="50"></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="100*" MinWidth="50"/>
                </Grid.ColumnDefinitions>
                <StackPanel Orientation="Vertical" Grid.RowSpan="2" >
                    <Grid>
                        <Image x:Name="LunarRepresentation" Width="50" Height="50"
                            Source="{Binding CurrentMoonImage, Source={StaticResource ViewModel}, Converter={StaticResource converter}}"></Image>
                        <Image x:Name="SignImage" Width="24" Height="24"
                            Source="{Binding SignImage, Source={StaticResource ViewModel}, Converter={StaticResource converter}}"
                            ToolTipService.ToolTip="{Binding SignName, Source={StaticResource ViewModel}}">
                        </Image>
                    </Grid>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                        <TextBlock x:Name="PercLightText" Text="{Binding PercLight, Source={StaticResource ViewModel}}" 
                                   Margin="2" Style="{StaticResource GeneralText}"></TextBlock>

                    </StackPanel>
                    <StackPanel Orientation="Vertical" Grid.Column="0" Grid.RowSpan="2" Margin="1" >
                        <TextBlock x:Name="MoonName" Style="{StaticResource GeneralText}"
                                   Text="{Binding MoonName, Source={StaticResource ViewModel}}"/>
                    </StackPanel>
                </StackPanel>
            </Grid>
        </Border>
    </Grid>
</UserControl>
